#pragma once

// DirectInput libraries
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")

struct DirectInput
{
	// Attributess
	IDirectInput8*		m_pDIObject;	// DirectInput object
	IDirectInputDevice8*	m_pDIKeyboard;	// Keyboard device
	IDirectInputDevice8*	m_pDIMouse;		// Mouse device
	char				buffer[256];	// Stores keyboard state
	DIMOUSESTATE2		mouseState;		// Mouse state for 8 button mouse
	POINT				currentMousePos;
	RECT				windowRect;

	// Constructor and Destructor
	DirectInput(HWND hWnd, HINSTANCE hInst);
	~DirectInput(void);

	// Behaviors
	bool Initialize( HWND hWnd, HINSTANCE hInst );
	void Update( HWND hWnd );
	void Shutdown( void );
	// Tell if a key is pressed
	bool CheckKeyboard( short key );
	// Tell if mouse button is pressed
	bool CheckMouseButtons( short buttonNumber );
	// Check to see if mouse was moved in the horizontal direction
	int CheckMouseMovedX(void);
	// Check to see if mouse was moved in the vertical direction
	int CheckMouseMovedY(void);
	// Check to see if the scroll wheel was used
	int CheckMouseScroll(void);
};
